<foreach name="dict" item="val" key="key">
    <input type="checkbox" name="{$name}[{$key}]" lay-filter="{$name}" value="{$key}" title="{$val}" <if condition="in_array($key,$valArr)">checked</if> />
</foreach>
<input type="hidden" name="{$name}" id="{$name}" value="{$value}">